﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Business;
using Models;

namespace RestaurentReviewWeb
{
    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {


            if (IsPostBack == false)
            {
                var restaurentLogic = new RestaurentLogic();
                List<Restaurent> restaurents = restaurentLogic.GetRestaurents();

                string html = string.Empty;
                foreach (var restaurent in restaurents)
                {
                    var res = string.Format(@"<p>{0}</p><p>{1}</p><p>{2}</p>", restaurent.Name, restaurent.Rating,
                                            restaurent.Description);
                    html += res;
                }
                pnlAllRestaurent.InnerHtml = html;
            }
        }
    }
}
